<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <a :href="url">连接</a>
        <img :src="imgUrl" alt="">
        <div class="static" :class="{'active':isActive, 'error':isError}"></div>
        <div :class="classes">div class="active"</div>
        <div :class="btn_classes">div class="btn btn-small btn-disabled"</div>
        <div :style="styles">div style="color: red; font-size: 14px;"</div>
    </div>
    <script src="https://unpkg.com/vue/dist/vue.min.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                url: 'https://github.com',
                imgUrl: 'https://www.baidu.com/img/baidu_jgylogo3.gif',

                isActive: true,
                isError: false,

                error: null,

                btnSize: 'large',
                btnDisable: true,

                styles: {
                    color: 'red',
                    fontSize: 14 + 'px'
                }
            },
            computed: {
                classes: function () {
                    return {
                        active: this.isActive && !this.error,
                        'text-fail': this.error && this.error.type === 'fail'
                    }
                },
                btn_classes: function () {
                    return [
                        'btn',
                        {
                            ['btn-' + this.btnSize]: this.btnSize !== '',
                            ['btn-disabled']: this.btnDisable
                        }
                    ];
                }

            }
        })
    </script>
</body>

</html>